<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    196. Delete Duplicate Emails
   </h1>
   <p>
    Write a SQL query to
    <strong>
     delete
    </strong>
    all duplicate email entries in a table named
    <code>
     Person
    </code>
    , keeping only unique emails based on its
    <i>
     smallest
    </i>
    <b>
     Id
    </b>
    .
   </p>
   <pre>
+----+------------------+
| Id | Email            |
+----+------------------+
| 1  | john@example.com |
| 2  | bob@example.com  |
| 3  | john@example.com |
+----+------------------+
Id is the primary key column for this table.
</pre>
   <p>
    For example, after running your query, the above
    <code>
     Person
    </code>
    table should have the following rows:
   </p>
   <pre>
+----+------------------+
| Id | Email            |
+----+------------------+
| 1  | john@example.com |
| 2  | bob@example.com  |
+----+------------------+
</pre>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <p>
    Your output is the whole
    <code>
     Person
    </code>
    &nbsp;table after executing your sql. Use
    <code>
     delete
    </code>
    statement.
   </p>
  </div>
  <div>
   <h1 class="question_title">
    196. 删除重复的电子邮箱
   </h1>
   <p>
    编写一个 SQL 查询，来删除&nbsp;
    <code>
     Person
    </code>
    &nbsp;表中所有重复的电子邮箱，重复的邮箱里只保留&nbsp;
    <strong>
     Id&nbsp;
    </strong>
    <em>
     最小&nbsp;
    </em>
    的那个。
   </p>
   <pre>+----+------------------+
| Id | Email            |
+----+------------------+
| 1  | john@example.com |
| 2  | bob@example.com  |
| 3  | john@example.com |
+----+------------------+
Id 是这个表的主键。
</pre>
   <p>
    例如，在运行你的查询语句之后，上面的
    <code>
     Person
    </code>
    表应返回以下几行:
   </p>
   <pre>+----+------------------+
| Id | Email            |
+----+------------------+
| 1  | john@example.com |
| 2  | bob@example.com  |
+----+------------------+
</pre>
  </div>
 </body>
</html>